<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'blog-form',
	'enableAjaxValidation'=>false,
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'discription'); ?>
            <?php
            echo $form->textArea($model,'discription',array('rows'=>10, 'cols'=>80));
            /*
            $this->widget('ext.ckeditor.CKEditorWidget',array(
  "model"=>$model,                 # Data-Model
  "attribute"=>'discription',          # Attribute in the Data-Model
  "defaultValue"=>$model->discription,     # Optional

  # Additional Parameter (Check http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html)
  "config" => array(
      "height"=>"400px",
      "width"=>"100%",
      "toolbar"=>"Full",
      ),

  #Optional address settings if you did not copy ckeditor on application root
  "ckEditor"=>Yii::app()->basePath."/../ckeditor/ckeditor.php",
                                  # Path to ckeditor.php
  "ckBasePath"=>Yii::app()->baseUrl."/ckeditor/",
                                  # Realtive Path to the Editor (from Web-Root)
  ) );
             *
             */
            ?>
		<?php //echo $form->textArea($model,'discription',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'discription'); ?>

	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'thumbnail_file'); ?>
                <?php echo CHtml::activeFileField($model, 'thumbnail_file'); ?>
		<?php echo $form->error($model,'thumbnail_file'); ?>
	</div>

	<div class="row">
            <?php
                $category_array = CHtml::listData(BlogCategory::model()->findAll(), "id", "name");
                ?>
                <?php echo $form->labelEx($model,'category'); ?>
                <?php echo $form->listBox($model,'category',$category_array); ?>
                <?php echo $form->error($model,'category'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'tag'); ?>
		<?php echo $form->textField($model,'tag',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'tag'); ?>
	</div>
	<div class="row">
                <?php
                $artist_array = CHtml::listData(Artist::model()->findAll(), "id", "name");
                $model->artist = explode(',', $model->artist);
                ?>
                <?php echo $form->labelEx($model,'artist'); ?>
                <?php echo $form->listBox($model,'artist',$artist_array,array('multiple'=>'multiple')); ?>
                <?php echo $form->error($model,'artist'); ?>
	</div>
        <div class="row">
            <?php
                $home_array = CHtml::listData(Home::model()->findAll(), "id", "name");
                ?>
                <?php echo $form->labelEx($model,'show_home'); ?>
                <?php echo $form->listBox($model,'show_home',$home_array); ?>
                <?php echo $form->error($model,'show_home'); ?>
	</div>
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->